home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_01_07 / 1n07036c < prev    next >
Text File  |  1990-10-14  |  346b  |  17 lines

  1.  
  2. LISTING 6
  3. #define SEND_TIMEOUT 5 * 1000     /* 5 seconds, in ms. */
  4.  
  5. void timeout(int nd)
  6. {
  7.     long tmo =   SEND_TIMEOUT;
  8.  
  9.     /* Set the timeout option, so our reads won't wait forever. */
  10.     if ((set_option(nd, DGRAM, NET_OPT_TIMEOUT,
  11.             (char far *)tmo, 4)) != 0) {
  12.         printf("Send: couldn't set timeout option.\n");
  13.         exit(1);
  14.     }
  15. }
  16.  
  17.